1. Field of the Invention
The present invention relates generally to the field of computer graphics. In particular to systems and method for generating and rendering images in three-dimensional graphics. More particularly, the present invention relates to a system and method for managing buffer space using tokens for a geometry pipeline of a graphics subsystem.
2. Description of the Background Art
Graphics systems and processors are well known in the art. There has been an increasing demand for graphics that are more realistic. The prior art has attempted to satisfy this demand with graphics systems that for render three-dimensional objects. The rendering of three-dimensional objects requires a greater number of computations and transformations such as shading, lighting, projection, perspective and texturing. However, one problem in the prior art is providing enough computational power and storage area to perform graphics operations. The computational requirement for such computation has increased as the number of bit per pixel has increased. This is particularly a problem in the manufacture of graphics controllers that are often formed on a single chip, and therefore, are limited in the storage area and processing power available.
Graphics processing for rendering three-dimensional objects includes a number of steps. By way of example, FIG. 1 shows a prior art pipeline for processing graphics computations required for rendering three-dimensional objects. This is generally referred to as a geometry pipeline in the art. The geometry pipeline preferably has a number of stages or units each of which performs a different type of processing. As shown in FIG. 1, a typical prior art geometry pipeline 100 includes: a model view transformation unit 102, a lighting unit 104, a projection unit 106, a clipping unit 108, a perspective transform unit 110, a triangle rendering unit 112, and a pixel rendering unit 114. Each of these units 102-114 performs conventional graphics operations such as disclosed by Foley, van Dam, et al in Computer Graphics: Principles and Practice, 1996. Exemplary prior art graphics controllers performing similar operations include the ViRGE graphics controller, manufactured and sold by S3 Incorporated of Santa Clara, Calif.
One particular problem with the prior art is the amount of storage required to perform these operations. Since each unit 102-114 in the geometry pipeline 100 may perform its operations at a different rate, and also because each unit 102-114 cannot begin processing until the previous unit 102-114 has completed its processing, the prior art is forced to include a series of buffers at the end of each unit 102-114. These buffers are shown with shading and denoted with reference numerals 116. However, these buffers are nearly always under utilized because in only the rarest of cases with every buffer for each unit 102-114 be filled. More commonly, buffers of one or two units 102-114 that are filled. However, the prior art requires these buffers that consume precious space storage space. Thus, the use of such buffers and the need to move data between the units 102-114 consumes a lot of bandwidth and resources. Therefore, there is a need for a system that is able to reduce the amount of storage space, and thereby reduce the amount of chip area required for graphics processing for rendering three-dimensional objects.
Yet another problem in the prior art is that while not all the data is needed for each stage of the pipeline, it must be moved to each successive stage and storage for the data is required at each successive stage. Therefore, the prior art unnecessarily moves data between stages that is not needed for operations in those stages. For example, even though color data and texture coordinates are not needed for the model view transformation, color data is provided to the prior art model view transformation unit. This is a particular problem when the data necessary for storing texture information is considered. Especially, for multi-texture environments, the problem of having to move and storing so much unused data can be a serious problem. Therefore, a system and method that can reduce the amount of data transferred in a geometry pipeline is needed.
Therefore, there is a need for systems and methods for organizing and managing the data used by a geometry pipeline in processing graphics data.
The present invention overcomes the deficiencies and limitations of the prior art with a token-based buffer system and method for a geometry pipeline in three-dimensional graphics. The token-based buffer system preferably comprises: a buffer control initialization (BCI) unit, a new token or index module, a geometry control pipeline, a vertex buffer, and a processing engine. The token-based buffer system provides a shared resource environment in which tokens are assigned for blocks of data. Each block of data includes that data necessary for each unit or stage in the geometry pipeline to perform its computation. The use of tokens is advantageous because it optimizes the storage efficiency for storing the blocks of data and ensures the correctness of the data as it is passed between stages.
The vertex buffer provides a storage area of predetermined sized for storing data. The vertex buffer preferably has a plurality of storage locations, each of the storage locations associated with a respective token. For each token there are a plurality of storage locations for storing different fields and data need for the different processing stages of the pipeline. The vertex buffer is preferably a shared resource that is used by different stages of the geometry pipeline and the processing engine. Thus, the present invention provides increased storage efficiency in storing the data used by the geometry pipeline.
The BCI unit is coupled to receive data and requests for processing. In response, the BCI unit stores data in the vertex buffer, secures a token for the data, and sends the token to the geometry control pipeline for the appropriate processing. The token provides an index or reference to the location in the vertex buffer where the data block has been stored. The token also has reference to empty fields where information from processing can be stored. The token or index module manages buffer capacity and provides a token to the next available portion in the vertex buffer, or if there is no additional capacity, indicates such. The token or index module is coupled to the BCI unit for getting the next available token, and to the geometry control pipeline for releasing a token for re-use after all processing for that token has been completed.
The geometry control pipeline is coupled to receive a token and processes the token through each stage of the geometry pipeline. The geometry control pipeline is also coupled to the vertex buffer and the processing engine. The geometry control pipeline is coupled to the vertex buffer to retrieve data and provide it to the processing engine. The geometry control pipeline is coupled to the processing engine to sent control signals to the processing engine to specify the operation that that the processing engine should perform with the data. One particularly advantageous feature of the present invention is that the token and geometry control pipeline allow the operations to be performed in parallel. For example, the geometry control pipeline permits the lighting transformation to be done in parallel with the projection transformation and the perspective transformation. Thus, the present invention provides a system that can reduce the amount of data that must be transferred in processing three-dimensional graphics objects. These and other features and advantages of the present invention may be better understood by considering the following detailed description of a preferred embodiment of the invention. In the course of this description, reference will frequently be made to the attached drawings.
FIG. 1 is a block diagram of a geometry pipeline of the prior art.
FIG. 2 is a block diagram of a computer system including the graphics system of the present invention.
FIG. 3 is a block diagram of the graphics unit of the present invention.
FIG. 4 is a high-level block diagram of a first embodiment of the graphics engine of the present invention.
FIG. 5A is a block diagram of a second and preferred embodiment of the graphics engine of the present invention.
FIG. 5B is a block diagram of a third embodiment of the graphics engine of the present invention.
FIG. 6A is a block diagram showing the processing of tokens according to second and preferred embodiment of the graphics engine, and the units that the ratio engine can be configured as under direction of the geometry pipeline.
FIG. 6B is a block diagram showing the processing of tokens according to third embodiment of the graphics engine, and the units that the ratio engine can be configured as under direction of the geometry pipeline.
FIG. 7A is a diagram showing a first embodiment for a data block in the vertex buffer of the present invention.
FIG. 7B is a diagram showing a second embodiment for the data block in the vertex buffer of the present invention.
FIG. 8 is a diagram showing a preferred embodiment for a vertex buffer of the present invention.
FIG. 9 is a flow chart of a method for processing of vertex data using the token-based management scheme of the present invention.